<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>表格</title>
    <style>
        table {
            border-collapse: collapse;
            width: 50%;
        }

        td {
            border: 1px black solid;
        }

        tbody > tr:hover{
            background-color: yellow;
        }
    </style>
</head>
<body>

<table>
<!--
    如果在table没有写tbody，则浏览器会自动创建tbody，
        并将所有的tr都放入到tbody
-->
    <tr>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
    </tr>
    <tr>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
    </tr>
    <tr>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
    </tr>
    <tr>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
    </tr>
    <tr>
        <td>A</td>
        <td>B</td>
        <td>C</td>
        <td>D</td>
    </tr>
</table>

</body>
</html>